package cn.hchaojie.javase.day01.exercise;

public class Ex2 {
	public static void main(String[] args) {
//		for (int i = 0; i < 4; i++) {
//			// args[0], args[1], args[2], args[3]
//			System.out.println(args[i]);
//		}
		
		if (args.length < 4) {
			System.out.println("参数不对！需要四个参数。");
			
			System.exit(-1);
		}

		double x1 = Double.parseDouble(args[0]);
		double y1 = Double.parseDouble(args[1]);
		double x2 = Double.parseDouble(args[2]);
		double y2 = Double.parseDouble(args[3]);
		
		double distance = Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2));
		System.out.println(distance);
	}
}
